import request from '@/utils/request'

export function listArticle(params) {
  return request({
    url:'/article/list',
    method:'get',
    params:params
  })
}

// 查询详细
export function getArticle(id) {
  return request({
    url: '/article/' + id,
    method: 'get'
  })
}

// 新增
export function addArticle(data) {
  return request({
    url: '/article',
    method: 'post',
    data: data
  })
}

// 修改
export function updateArticle(data) {
  return request({
    url: '/article',
    method: 'put',
    data: data
  })
}

// 删除
export function delArticle(id) {
  return request({
    url: '/article/' + id,
    method: 'delete'
  })
}

export function listCategory(params) {
  return request({
    url:'/category/list',
    method:'get',
    params:params
  })
}